home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-07-15 | 2.3 KB | 85 lines | [TEXT/CWIE] |
- //sysEnv.h ©1996 Brian Bergstrand 07/16/96
-
- //headers
- #include "machineEnvClass.h"
-
- //constants - these should really go in their own header file
- //but since there are not that many it's ok
- const kBaseResID=128;
- const kDialogResID=kBaseResID;
- const kAlertID=kBaseResID;
- const kErrorStringsID=kBaseResID+2000;
- const kArrowCursor=1;
- const kWatchCursor=2;
- const kSleep=20L;//how much time to give to other Apps
- const kOn=1;
- const kOff=0;
-
- const mApple=kBaseResID;//Apple menu
- const iAbout=1;
-
- const mFile=kBaseResID+1;//File menu
- const iGetInfo=1;
- const iQuit=3;
-
- const iSysVer=9;//dialog static text items
- const iUpdateVer=10;
- const iMachine=11;
- const iMachineID=12;
- const iProcessor=13;
- const iRealMem=14;
- const iLogicalMem=15;
-
- #define kMoveToFront (WindowPtr)-1L//technically not C++ but it won't hurt
-
- //classes
- class AppGlobals
- {
- public:
- AppGlobals () {done = dialogActive = false;}//constructor
- /*The destructor is not declared virtual, because there is to much
- overhead for only having 2 vars. If you subclass from this, and
- your class has it's own destructor, make sure you declare this
- destructor virtual, or you could run into trouble when your
- objects are destructed. */
- ~AppGlobals () {}//destructor - does nothing
-
- Boolean done;
- Boolean dialogActive;
- };
-
- //structs
- struct TextHandles
- {//handles to the static text items in the main dialog
- Handle sysVerH;
- Handle updateVerH;
- Handle machineH;
- Handle machineIDH;
- Handle processorH;
- Handle realMemH;
- Handle logicalMemH;
- };
-
- //function prototypes
- void SwitchCursor (int *);
- void InitToolBox (void);
- void MenuBarInit (void);
- void EventLoop (void);
- void DoEvent (EventRecord *);
- void HandleMouseDown (EventRecord *);
- void HandleMenuChoice (long *);
- void HandleAppleChoice (short *);
- void HandleFileChoice (short *);
- void HandleEnvDialog (void);
- static pascal void DrawButtonBorder(WindowPtr, short);
- void GetSysEnv (TextHandles **);
- Str255 * FindMachine (long *, MachineEnv **);
- Str255 * FindSystem (long *);
- Str255 * FindProcessor (long *);
- void SetStaticString (Handle, Str255 *);
- void SetStaticString (Handle, char *);
- void HandleDialogEvent(EventRecord *);
- Boolean EventFilter(EventRecord *, WindowPtr);
- static ControlHandle GetCtlHandle(DialogPtr, short);
- void HandleError (short, Boolean, Str255);
- inline void Quit (void);